/* This is the place to store common materials to render.
All object will get information here to render everything on its own.
*/
#pragma once
#include "GLES2\gl2.h"
#include "Shaders.h"
#include "..\Utilities\Utilities.h"
#define GetHudMaterial()	HudMaterial::GetInstance()

class HudMaterial
{
protected:
	HudMaterial () {}
	~HudMaterial () { glDeleteBuffers(1, &m_boId); }

	/*implicit methods exist for the copy constructor and operator= and we want to forbid calling them.*/
	HudMaterial (const HudMaterial &){} 
	HudMaterial& operator = (const HudMaterial &){}

public:
	static void CreateInstance ()
    {
        if ( ms_pInstance == NULL )
		   ms_pInstance = new HudMaterial();
    }
	static HudMaterial * GetInstance () 
    {
	   return ms_pInstance;
    }
	static void DestroyInstance () 
    {
	   if ( ms_pInstance )
	   {
		 delete ms_pInstance;
		 ms_pInstance = NULL;
	   }
    }

	void		Init ();
	Shaders*	GetShader () { return &m_shader; }
	GLuint		GetModel () { return m_boId; }

protected:
	static HudMaterial * ms_pInstance;
	
	GLuint		m_boId;
	Shaders		m_shader;
};